package org.jeecg.modules.flower.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.flower.entity.FlowerOutorderPreinfo;
import org.jeecg.modules.flower.mapper.FlowerOutorderPreinfoMapper;
import org.jeecg.modules.flower.service.IFlowerOutorderPreinfoService;
import org.jeecg.modules.system.service.ISysDictService;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: 预出库单子表
 * @Author: jeecg-boot
 * @Date:   2022-06-27
 * @Version: V1.0
 */
@Service
public class FlowerOutorderPreinfoServiceImpl extends ServiceImpl<FlowerOutorderPreinfoMapper, FlowerOutorderPreinfo> implements IFlowerOutorderPreinfoService {


	@Autowired
	private FlowerOutorderPreinfoMapper flowerOutorderPreinfoMapper;
	
	@Override
	public List<FlowerOutorderPreinfo> selectByMainId(String mainId) {
		LambdaQueryWrapper<FlowerOutorderPreinfo> lambdaQueryWrapper =new LambdaQueryWrapper<>();
		lambdaQueryWrapper.eq(FlowerOutorderPreinfo::getOrderId,mainId);
		List<FlowerOutorderPreinfo> flowerOutorderPreinfos = flowerOutorderPreinfoMapper.selectList(lambdaQueryWrapper);
//		for(FlowerOutorderPreinfo flowerOutorderPreinfo:flowerOutorderPreinfos){
//			Result<String> storehouse = sysDictServiceClient.getDictTextOpen("storehouse",
//					flowerOutorderPreinfo.getStorehouse());
//			if(storehouse != null)
//				flowerOutorderPreinfo.setStorehouse(storehouse.getResult());
//		}
		return flowerOutorderPreinfos;
//		return flowerOutorderPreinfoMapper.selectByMainId(mainId);
	}
	@Override
	public List<FlowerOutorderPreinfo> selectByMainNo(String mainNo) {
		List<FlowerOutorderPreinfo> flowerOutorderPreinfos = flowerOutorderPreinfoMapper.selectByMainNo(mainNo);
		return flowerOutorderPreinfos;
	}
}
